import request from '@/utils/request.js'

// 获取菜单列表
export const getMenusAPI = function() {
  return request.get('/menus')
}

// 用户列表请求api
export const getUsersAPI = function(params) {
  return request.get('/users', {
    params
  })
}
// 用户状态修改
export const putUsersStuAPI = function(data) {
  return request.put(`users/${data.id}/state/${data.state}`)
}
// 新增用户api
export const postUsersAPI = function(data) {
  return request.post('/users', data)
}
// 修改用户数据
export const putUsersAPI = function(data) {
  return request.put(`users/${data.id}`, data)
}
// 删除用户
export const deleteUsersAPI = function(id) {
  return request.delete(`users/${id}`)
}
export default {
  getMenusAPI,
  getUsersAPI,
  putUsersStuAPI,
  postUsersAPI,
  putUsersAPI,
  deleteUsersAPI

}
